package pac1_rgr;


import process.Actor;

public class Time extends Actor {
private Main gui;
protected double time1=8;
protected double time2=6;
protected double time3=1;
protected double time4=22;
protected double finishTime;

public Time(Main main) {
	gui=main;
	finishTime=gui.getChooseDataModelTime().getDouble();
	this.setNameForProtocol("Таймер");
	
}
	@Override
	protected void rule() {
		while(getDispatcher().getCurrentTime()<finishTime){
		holdForTime(6);
		getDispatcher().printToProtocol("6 ранку");
		holdForTime(2);
		getDispatcher().printToProtocol("8 ранку");
		holdForTime(9);
		getDispatcher().printToProtocol("5 вечора");
		holdForTime(5);
		getDispatcher().printToProtocol("10 вечора");
		holdForTime(2);
		getDispatcher().printToProtocol("пiвнiч");
	}
	}
}
